﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace WcfContrib.Internal
{
    class ComparerByType<T> : IEqualityComparer<T>
    {
        static ComparerByType<T> instance = new ComparerByType<T>();
        internal static ComparerByType<T> Instance
        {
            get
            {
                return instance;
            }
        }

        #region IEqualityComparer<T> Members

        public bool Equals(T x, T y)
        {
            return x.GetType().Equals(y.GetType());
        }

        public int GetHashCode(T obj)
        {
            return obj.GetHashCode();
        }

        #endregion
    }
}
